package com.ubb.damate.service.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.ubb.damate.model.UserEvent;
import com.ubb.damate.service.UserEventServiceLocal;
import com.ubb.damate.service.UserEventServiceRemote;

/**
 * Session Bean implementation class UserEventService
 */
@Stateless
public class UserEventService implements UserEventServiceRemote, UserEventServiceLocal {

	@PersistenceContext(unitName = "damate-pu")
	private EntityManager em;

	@Override
	public UserEvent createOrUpdate(UserEvent userEvent) {
		return em.merge(userEvent);
	}

	@Override
	public void delete(UserEvent userEvent) {
		 em.remove(em.merge(userEvent));
	}

	@Override
	public UserEvent find(UserEvent userEvent) {
		return em.find(com.ubb.damate.model.UserEvent.class, userEvent);
	}

}